load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "metaconfig_types",
    srcs = glob(["types/src/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "types"},
    named_deps = {"bincode": "fbsource//third-party/rust:bincode-2"},
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:ascii",
        "fbsource//third-party/rust:clap",
        "fbsource//third-party/rust:derive_more",
        "fbsource//third-party/rust:lazy_static",
        "fbsource//third-party/rust:mysql_common",
        "fbsource//third-party/rust:parking_lot",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:rusoto_core",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_derive",
        "fbsource//third-party/rust:serde_json",
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/scuba_stub:scuba",
        "//common/rust/shed/sql:sql",
        "//eden/mononoke/bookmarks:bookmarks_types",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/permission_checker:permission_checker",
    ],
)

rust_library(
    name = "metaconfig_parser",
    srcs = glob(["parser/src/**/*.rs"]),
    autocargo = {"cargo_toml_dir": "parser"},
    test_deps = [
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:pretty_assertions",
        "fbsource//third-party/rust:tempfile",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types-mocks",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:ascii",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:nonzero_ext",
        "fbsource//third-party/rust:rusoto_core",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_ignored",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:toml",
        "fbsource//third-party/rust:tracing",
        ":metaconfig_types",
        "//common/rust/shed/cached_config:cached_config",
        "//configerator/structs/scm/mononoke/repos:commitsync-rust",
        "//configerator/structs/scm/mononoke/repos:repos-rust",
        "//eden/mononoke/bookmarks:bookmarks_types",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/scm/lib/repo/url:repourl",
    ],
)
